home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / SetUp / 03 / 16.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-07-04  |  4.6 KB  |  210 lines

  1. /*
  2.                                  Visual FX
  3.                                     For
  4.                                  Image FX
  5.                                SetUp Script
  6.                            Written By J.L. White
  7.  
  8.                          (C)1997 Merlin's Software
  9.  
  10. */
  11. parse arg Num Frames
  12. options results
  13. address "IMAGEFX.1"
  14.     RequestResponse "Do You Need Instructions?"
  15.     if rc = 0 then do
  16.         call Docs()
  17.         end    
  18.     ReDraw On
  19.  
  20.  
  21. if exists("libs:flyer.library") then do
  22.     if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
  23.         RequestNotify 'Flyer Must Be Running First!'
  24.         exit
  25.         end
  26.     call OpenFlyStuff()
  27.  
  28.  
  29.     Gadget.1 = 'D/110/22/120/ImageA Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  30.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  31.     if rc ~= 0 then do
  32.         call CloseStuff()
  33.         exit 0
  34.         end
  35.     else do
  36.         IAType = RESULT.1
  37.            end
  38.  
  39.     call GetA()
  40. end
  41. else do
  42.     Gadget.1 = 'D/110/22/120/ImageA Type/2/FRAME/SEQUENCE'
  43.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  44.     if rc ~= 0 then do
  45.         call CloseStuff()
  46.         exit 0
  47.         end
  48.     else do
  49.         IAType = RESULT.1+2
  50.            end
  51.  
  52.     call GetA()
  53. end
  54.  
  55. if FlyOn = 1 then
  56.     call CloseStuff()
  57.  
  58.  
  59.  
  60.  
  61. call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
  62. call writeln TempFile,PicAName
  63. call writeln TempFile,Start
  64. call writeln TempFile,End
  65. call writeln TempFile,IAType
  66. call close TempFile
  67. exit
  68.  
  69.  
  70.  
  71. Docs:
  72.     text1 = '"This effect takes a sequence of images or a"'
  73.     text2 = '"clip and combines a number of processes, to"'
  74.     text3 = '"give the image a blue print type look."'
  75.  
  76.     Gadget.1  = 'TEXT LE=10 TE=4 LB='text1' '
  77.     Gadget.2  = 'TEXT LE=10 TE=14 LB='text2' '
  78.     Gadget.3  = 'TEXT LE=10 TE=24 LB='text3' '
  79.     Gadget.4 = 'END'
  80.     NewComplexRequest '"Instructions For Effect #16"'  Gadget 340 36
  81.  
  82. return
  83.  
  84.  
  85.  
  86. GetFile:
  87.     parse Arg Title, Path
  88.     Address FLY_1 SetString Path
  89.     Address FLY_1 GetFileNameNT Title
  90. return result
  91.  
  92. GetFileName: procedure  
  93.    ARG CompleteName
  94.    c = lastpos("/",CompleteName)
  95.    if c = 0 then c = lastpos(":",CompleteName)
  96.    return substr(CompleteName, c + 1)
  97.  
  98.  
  99. GetA:
  100.  if IAType = 0 then do
  101.     call Switcher(TOSW)
  102.     PicAName = GetFile("Select Flyer Clip For ImageA!  ",DriveName)
  103.     Name = GetFileName(PicAName)
  104.     if Name = "" then do
  105.         Address FLY_1 OK_TEXT " OK "
  106.         Title = "You Must Enter A Valid Clip Name To Use!"
  107.         Address FLY_1 FYINT Title
  108.         Address FLY_1 Quit
  109.         call Switcher(TOWB)
  110.         exit
  111.         end
  112.     Address FLY_1 SetFileName PicAName
  113.     Address FLY_1 GetClipLength PicAName
  114.     End = result
  115.     Start = 0
  116.     Address FLY_1 Program "5"
  117.     Address FLY_1 StartNum Start
  118.     Address FLY_1 EndNum End
  119.     Address FLY_1 CurrentNum "0"
  120.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  121.     Start = word(result,1)*2
  122.     End = word(result,2)*2
  123.     Start  = Start + 1
  124.     End = End +2
  125.     call addlib('PROJECT_REXX_PORT' , 0)
  126.     call addlib(TOASTERLIB,0)
  127.     call Switcher(TOWB)
  128.     address command "C:Wait 1"
  129.     ScreenToFront
  130.     end
  131.    if IAType = 1 then do
  132.     RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
  133.     PicAName = result
  134.     Name = GetFileName(PicAName)
  135.     if Name = "" then do
  136.         Title = "You Must Enter A Valid Name To Use!"
  137.         RequestNotify Title
  138.         if FlyOn = 1 then Address FLY_1 Quit
  139.         exit
  140.         end
  141.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  142.     End = result
  143.     Start = 1
  144.     end
  145.    if IAType = 2 then do
  146.     RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
  147.     PicAName = result
  148.     Name = GetFileName(PicAName)
  149.     if Name = "" then do
  150.         Title = "You Must Enter A Valid Name To Use!"
  151.         RequestNotify Title
  152.         if FlyOn = 1 then Address FLY_1 Quit
  153.         exit
  154.         end
  155.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  156.     End = result
  157.     Start = 1
  158.     end
  159.    if IAType = 3 then do
  160.     RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
  161.     PicAName = result
  162.     Name = GetFileName(PicAName)
  163.     if Name = "" then do
  164.         Title = "You Must Enter A Valid Name To Use!"
  165.         RequestNotify Title
  166.         if FlyOn = 1 then Address FLY_1 Quit
  167.         exit
  168.         end
  169.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  170.     End = result
  171.     Start = 1
  172.     end
  173. return
  174.  
  175. CloseStuff:
  176.     Address FLY_1 Quit
  177.     call remlib('ToasterARexx.port')
  178.     call remlib('PROJECT_REXX_PORT')
  179. return
  180.  
  181.  
  182. OpenFlyStuff:
  183.     FlyOn = 1
  184.     address command "run VFXIFX:FLY" 
  185.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  186.         address command "wait 1"
  187.         end
  188.     TOASTERLIB="ToasterARexx.port"
  189.     call remlib('ToasterARexx.port')
  190.     call remlib('PROJECT_REXX_PORT')
  191.     call addlib('PROJECT_REXX_PORT' , 0)
  192.     call addlib(TOASTERLIB,0)
  193.     DriveName = FindDrive()
  194. return
  195.  
  196.  
  197. FindDrive:
  198.     address command "C:Info >RAM:DriveList"
  199.     call open TempFile,"RAM:DriveList",R
  200.     do until eof(TempFile)
  201.         line = readln(TempFile)
  202.         parse var line Drive" "Rest
  203.         if Drive = "FA0:" then 
  204.             FlyVolume = word(Rest,7)":"
  205.     end
  206.     call close TempFile
  207.     address command "Delete >NIL: RAM:DriveList"
  208. return FlyVolume
  209.  
  210.